package project;
import oracle.kv.KVStoreConfig;
import oracle.kv.KVStoreFactory;
/**
 * la classe de l'etape 3 - equillibrage
 * */
public class Etape_3 {
	// numbre de applications pour chaque store
	public static int i = 5;
	// matrix de store
	public static Store[] stores;

	/**
	 * la classe d'initialisation
	 * */
	public static void init() {
		String[] storeNames = new String[Init_balance.N];
		storeNames[0] = "kvstore";
		storeNames[1] = "kvstore";
		String[] hostNames = new String[Init_balance.N];
		hostNames[0] = "ari-31-312-14";
		hostNames[1] = "ari-31-312-15";
		String[] hostPorts = new String[Init_balance.N];
		hostPorts[0] = "5000";
		hostPorts[1] = "5000";

		stores = new Store[Init_balance.N];
		for (int i = 0; i < Init_balance.N; i++) {
			stores[i] = new Store();
			stores[i].setStore(KVStoreFactory.getStore(new KVStoreConfig(
					storeNames[i], hostNames[i] + ":" + hostPorts[i]))) ;
		}
	}

	public static void main(String[] args) {
		init();
		Application_balance application  = new Application_balance(stores, 18);
		application.start();
	}
	
}
